package com.itheima.d7_interface_demo;

import java.util.ArrayList;

public class StudentManager {
    private ArrayList<Student> stus = new ArrayList<>();
    private StudentOperator operator =new StudentOperatorImpl1();
    //添加数据
    public StudentManager(){
        stus.add(new Student("董卓","男",60));
        stus.add(new Student("吕布","男",90));
        stus.add(new Student("曹操","男",80));
        stus.add(new Student("貂蝉","女",100));
        stus.add(new Student("关羽","男",75));

    }
//    功能1：要求打印出全班学生的信息； 功能2：要求打印出全班学生的平均成绩。
    //显示打印全班学生信息
    public void printAll(){
        operator.printAll(stus);
    }

    //显示打印平均成绩
    public void printAvg(){
        operator.printAvg(stus);
    }
}
